package com.paipai.feign;

import com.paipai.dto.Document;
import com.paipai.dto.ProductVo;
import com.paipai.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

@FeignClient(name="com-service-seller")
public interface ProductFeign {
    @RequestMapping("/product/modifyStateById")
    int modifyStateById(@RequestParam("productId") Long productId, @RequestParam("state")Integer state);

    @RequestMapping("/product/createProduct")
    String createProduct(@RequestParam("name") String name,@RequestParam("typeId") Long typeId,@RequestParam("detail") String detail,@RequestParam("imageUrl") MultipartFile[] imageUrl);

    @RequestMapping("/product/selectProductByState")
    List<ProductVo> selectProductByState();

    @RequestMapping("/product/modify")
    List<Document> modify(@RequestBody Product product);

    @RequestMapping("/product/updateInfo")
    String updateInfo(@RequestParam("productId")Long productId, @RequestParam("name")String name, @RequestParam("typeId")Long typeId, @RequestParam("detail")String detail, @RequestParam("createtime")Date createtime, @RequestParam("imageUrl")MultipartFile[] imageUrl, @RequestParam("document")String document);

    @RequestMapping("/product/selectByState")
    List<Product> selectByState();

}
